﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MvcControlsToolkit
{
    public class TickOptions: BaseObject
    {
        public bool EnableFontSupport
        {
            get
            {
                if (Attributes.ContainsKey("enableFontSupport"))
                    return bool.Parse(Attributes["enableFontSupport"]);
                else return false;
            }
            set { Attributes["enableFontSupport"] = value.ToString().ToLower(); }
        }

        /// <summary>
        /// 
        /// </summary>
        public int Angle
        {
            get
            {
                if (Attributes.ContainsKey("angle"))
                    return int.Parse(Attributes["angle"]);
                else return 1;
            }
            set { Attributes["angle"] = value.ToString().ToLower(); }
        }

        public string LabelPosition
        {
            get
            {
                return GetString("labelPosition");
            }
            set { SetString("labelPosition", value); }
        }

        /// <summary>
        /// Wether or not to draw the gridline on the grid at this tick
        /// </summary>
        public bool ShowGridline
        {
            get
            {
                if (Attributes.ContainsKey("showGridline"))
                    return bool.Parse(Attributes["showGridline"]);
                else return false;
            }
            set { Attributes["showGridline"] = value.ToString().ToLower(); }
        }

        /// <summary>
        /// String passed to the formatter
        /// </summary>
        public string FormatString{
            get
            {
                return GetString("formatString");
            }
            set{
                SetString("formatString", value);
            }
        }

        public bool ShowMark
        {
            get
            {
                if (Attributes.ContainsKey("showMark"))
                    return bool.Parse(Attributes["showMark"]);
                else return true;
            }
            set { Attributes["showMark"] = value.ToString().ToLower(); }
        }
    }
}
